//
//  BaseTableViewController.m
//  jiedian
//
//  Created by 美街美店 on 16/5/5.
//  Copyright © 2016年 com.jiedian.www. All rights reserved.
//

#import "BaseTableViewController.h"
#import "SDImageCache.h"

@interface BaseTableViewController ()

@end

@implementation BaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor = LY_RGB(240, 244, 255);
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    //适配ios10
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.view.backgroundColor = LY_RGB(245, 245, 245);
//    _getAppDelegate
 
//    [self wr_setNavBarBarTintColor:ColorWithRGB(220, 69, 105)];
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"云"] forBarMetrics:UIBarMetricsDefault];
    [self ly_setNavBarBarTintColor:LY_Theme_Color];
    [self wr_setNavBarTintColor:[UIColor whiteColor]];
    [self wr_setNavBarTitleColor:[UIColor whiteColor]];
    
//     [self.navigationController.navigationBar setBackgroundImage:_imageName(@"pic_bill_background") forBarMetrics:UIBarMetricsDefault];
   
    //设置坐标
    self.edgesForExtendedLayout=UIRectEdgeBottom;
    
//    //退出登录后清除所有view
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cleanAllView) name:_outLogin object:nil];
    
}

#pragma mark——————————收到内存警告
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // 清除sd的内存缓存
    [[SDImageCache sharedImageCache] setValue:nil forKey:@"memCache"];
    
}

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
    [self.view endEditing:YES];
}


#pragma mark----------------设置单元格分割线填充满屏幕--------------------
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([cell respondsToSelector:@selector(setSeparatorInset:)])
    {
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)])
    {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

- (void)popVc
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)dealloc
{
     [self.view endEditing:YES];

    [[NSNotificationCenter defaultCenter]removeObserver:self];
    

}

#pragma mark————————程序即将离开页面
- (void)viewWillDisappear:(BOOL)animated
{
    
    [super viewWillDisappear:animated];
    
    
    [self.view endEditing:YES];
    
}
 

//#pragma mark————————————清除所有View
//- (void)cleanAllView
//{
//    [self.view ly_removeAllSubviews];
//}



@end
